package factory.factory_method;

public class NYPizzaStore extends PizzaStore {

    @Override
    protected Pizza createPizza(String type) {
        Pizza pizza;

        if ("cheese".equals(type)) {
            pizza = new NYStyleCheesePizza();
        } else if ("greek".equals(type)) {
            pizza = new NYStyleGreekPizza();
        } else if ("pepperoni".equals(type)) {
            pizza = new NYStylePepperoniPizza();
        } else if ("clam".equals(type)) {
            pizza = new NYStyleClamPizza();
        } else if ("veggie".equals(type)) {
            pizza = new NYStyleVeggiePizza();
        } else {
            throw new RuntimeException("New York pizza store has no " + type + " pizza.");
        }

        return pizza;
    }

}
